import { queryDevRepairDet } from '../services/api';

export default {
  namespace: 'devrepair',

  state: {
    detail: {},
  },

  effects: {
    *fetch({ payload }, { call, put }) {
      const response = yield call(queryDevRepairDet, payload);
      const result = response.devRepairDet;
      //console.log('log', result);
      yield put({
        type: 'save',
        payload: result,
      });
    },
  },

  reducers: {
    save(state, action) {
      return {
        detail: action.payload,
      };
    },
  },
};
